package edu.xlh.travel.websocket.service.impl;

import edu.xlh.travel.websocket.dao.EmpInfoDao;
import edu.xlh.travel.websocket.domin.EmpInfo;
import edu.xlh.travel.websocket.service.EmpInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class EmpInfoServiceImpl implements EmpInfoService {
    @Autowired
    private EmpInfoDao empInfoDao;
    @Override
    public EmpInfo findEmpInfoById(String userId) {
        return empInfoDao.findById(userId).get();
    }

    @Override
    public void save(EmpInfo empInfo) {
        empInfoDao.save(empInfo);
    }

    @Override
    public int updateEmpInfoByUserId(String userId , String userName) {
        return empInfoDao.updateEmpInfoByUserId(userId , userName);
    }
}
